<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/sys/include/taglib.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>添加物品信息</title>
<%@ include file="/WEB-INF/sys/include/css.jsp"%>
</head>
<body>
<form id="form" action="${path}/res/save.json" method="post">
<div class="form">
	<div class="group">
		<div class="label">*物品代码:</div>
		<div class="item"><input type="text" name="resDm" id="resDm"/></div>
	</div>
	<div class="group">
		<div class="label">*物品条码:</div>
		<div class="item"><input type="text" name="resTm" id="resTm"/></div>
	</div>
	<div class="group">
		<div class="label">*物品名称:</div>
		<div class="item"><input type="text" name="resName" id="resName"/></div>
	</div>
	<div class="group">
		<div class="label">拼音助记符:</div>
		<div class="item"><input type="text" name="pinyin" id="pinyin"/></div>
	</div>
	<div class="group">
		<div class="label">*物品型号:</div>
		<div class="item"><input type="text" name="model" id="model"/></div>
	</div>
	<div class="group">
		<div class="label">*物品类别:</div>
		<div class="item">
			<input type="text" id="typeName" name="typeName" />
			<input type="hidden" name="typeid" id="typeid" />
		</div>
		<div class="item" id="typeNameTip"></div>
	</div>
	<div class="group">
		<div class="label">*单位:</div>
		<div class="item"><input type="text" name="unit" id="unit"/></div>
	</div>
	<div class="group">
		<div class="label">*生产厂家:</div>
		<div class="item"><input type="text" name="sccj" id="sccj"/></div>
	</div>
	<div class="group">
		<div class="label">备注:</div>
		<div class="item"><textarea id="remark" name="remark"></textarea></div>
	</div>
	<!-- <div class="group">
		<div class="label">库存下限:</div>
		<div class="item"><input type="text" name="stockMin" id="stockMin"/></div>
	</div>
	<div class="group">
		<div class="label">库存上限:</div>
		<div class="item"><input type="text" name="stockMax" id="stockMax"/></div>
	</div> -->
	<div class="group">
		<div class="label">默认入库价格:</div>
		<div class="item"><input type="text" name="inPrice" id="inPrice"/></div>
	</div>
	<div class="group">
		<div class="label">默认出库价格:</div>
		<div class="item"><input type="text" name="outPrice" id="outPrice"/></div>
	</div>
	<div class="group">
		<div class="label">库存平均价格:</div>
		<div class="item"><input type="text" name="middlePrice" id="middlePrice"/></div>
	</div>
	<div class="buttons">
		<button class="highlight" id="submit1" type="button">确定</button>
		<button type="button" id="cancel1">取消</button>
	</div>
</div>
</form>
<%@ include file="/WEB-INF/sys/include/script.jsp" %>
<script type="text/javascript">
$(function() {
	createSelect("typeName", "typeid", {
		textField: 'text', valueField:'id',
		url:'${path}/restype/getTypeData.json'
	});
	
	$("#form").ligerForm({inputWidth: 300});
	
	verifyForm("form", {}, function(){
		$("#form").ajaxForm(function(data){
			UiUtil.isSuccess(data, "添加物品信息成功", function(){
				UiUtil.closeForm(true);
			});
		});
	});
	
	$("#submit1").click(function(){
		UiUtil.lockButton('submit1');
		$("#form").submit();
	});

	$("#cancel1").click(function(){
		UiUtil.closeForm();
	});
	
});
</script>
</body>
</html>